package rabbitmq.producer;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import rabbitmq.comm.Event;

import java.util.Date;

@RunWith(SpringRunner.class)
@SpringBootTest
public class Producer {

    @Autowired
    private Sender sender;

    @Test
    public void test(){
        int i = 0;
        while (i++ < 1 ){
            Event ev = Event.builder().id("2020").action(123D).content("new ev").time(new Date()).build();
            sender.send(ev);
        }
    }
}
